home *** CD-ROM | disk | FTP | other *** search
- Path: interramp.com!usenet
- From: "James A. Clifton" <jclifton@interramp.com>
- Newsgroups: comp.lang.c
- Subject: Re: Help referencing an array of strings
- Date: Wed, 06 Mar 1996 12:56:24 -0500
- Organization: Ethnohistory Associates
- Message-ID: <313DD1C8.363C@interramp.com>
- References: <313C7F02.5D54@interramp.com> <Pine.A32.3.91.960306003353.206714F-100000@black.weeg.uiowa.edu>
- NNTP-Posting-Host: ip119.kalamazoo.mi.interramp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0 (Win95; U)
-
- The Amorphous Mass wrote:
- >
- > On Tue, 5 Mar 1996, James A. Clifton wrote:
- >
- > > I need to have an array of fixed-length strings in a structure.
- > > The problem I am having is trying to reference a particular string
- > > in the array:
- > >
- > > typedef struct ss {
- > > /* some other data */
- > > char sa[N][M];
- > > } ss;
- > >
- > > ss s;
- > >
- > > Now how do I reference the Nth string???
- >
- > s.sa[N]
-
- I've tried this and both bcc & gcc give me "invalid indirection"
-
- To further complicate I am actually using an array of these
- structures so I need:
-
- ss s[MAX_ARR];
-
- {
- /* the mth structure's nth string */
- printf("%i\n", s[m].sa[m]);
- /* compiler gives me "invalid indirection here */
- }
-